package com.douples.citywide;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;

import com.douples.citywide.adapter.MyFragmentAdapter;
import com.douples.citywide.fragment.MyFragment;
import com.douples.citywide.transformer.RotateDownPageTransformer;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by liuwei on 2017/7/7.
 */

public class TestActivity extends AppCompatActivity {
    private ViewPager banner;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.banner_layout);
        banner = (ViewPager) findViewById(R.id.banner);
        MyFragmentAdapter myFragmentAdapter = new MyFragmentAdapter(getSupportFragmentManager(), getImgs());
        banner.setAdapter(myFragmentAdapter);
        banner.setPageTransformer(false,new RotateDownPageTransformer());
    }

    private List<MyFragment> getImgs() {
        List<MyFragment> list = new ArrayList<>();
        list.add(MyFragment.getInstance("http://img5.imgtn.bdimg.com/it/u=3266937334,1410324185&fm=26&gp=0.jpg"));
        list.add(MyFragment.getInstance("http://img1.imgtn.bdimg.com/it/u=1534702010,3459782016&fm=214&gp=0.jpg"));
        list.add(MyFragment.getInstance("http://img4.imgtn.bdimg.com/it/u=919194779,3920175726&fm=214&gp=0.jpg"));
        return list;
    }


}
